package Persondata;

import org.apache.wicket.PageParameters;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.hibernate.Session;

import db.HibernateHelper;

public class PersonLoeschen extends WebPage {
	public PersonLoeschen(PageParameters params) {
		Session session = HibernateHelper.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		session.get(Person.class, params.getInt("idInternal"));
		session.delete(session.get(Person.class, params.getInt("idInternal")));
		session.getTransaction().commit();
		this.setResponsePage(PersonWeb.class, params);
		
	}

}
